package org.eclipse.emf.cdo.ui.merge;

import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.spi.cdo.DefaultCDOMerger.Conflict;

/**
 * Defines the Object for a Conflict Node in the tree.
 * @author Thomas Halmetschlager
 *
 */
public class ConflictTreeParent extends TreeParent{

	/** The conflict. */
	private Conflict conflict;
	
	/**
	 * Gets the conflict.
	 *
	 * @return the conflict
	 */
	public Conflict getConflict() {
		return conflict;
	}
	
	/**
	 * Sets the conflict.
	 *
	 * @param conflict the new conflict
	 */
	public void setConflict(Conflict conflict) {
		this.conflict = conflict;
	}
	
	/**
	 * Gets the conflict object CDO ID.
	 *
	 * @return the conflict object CDO ID
	 */
	public CDOID getConflictObjectID() {
		return conflictObjectID;
	}
	
	/**
	 * Sets the conflict object CDO ID.
	 *
	 * @param conflictObjectID the new conflict object CDO ID
	 */
	public void setConflictObjectID(CDOID conflictObjectID) {
		this.conflictObjectID = conflictObjectID;
	}

	/** The conflict object CDO ID. */
	private CDOID conflictObjectID;
	
	/**
	 * Instantiates a new conflict tree parent.
	 *
	 * @param name the name
	 */
	public ConflictTreeParent(String name) {
		super(name);
	}
	
	/**
	 * Instantiates a new conflict tree parent.
	 *
	 * @param name the name
	 * @param conflict the conflict object CDO ID
	 */
	public ConflictTreeParent(String name, Conflict conflict) {
		super(name);
		this.conflict = conflict;
		conflictObjectID = conflict.getID();
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.emf.cdo.ui.merge.TreeObject#toString()
	 */
	@Override 
	public String toString() {
		return "Conflict on " + conflictObjectID.toString();
	} 
}
